﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GMLogging;

namespace ThouShaltNotBrick.Models
{
    public sealed class BrickStatesData
    {
        #region Properties
        private List<BrickStateData> mBrickStates;
        #endregion

        #region Constructors
        public BrickStatesData(List<BrickStateData> pBrickStates)
        {
            if (pBrickStates == null)
            {
                Exception e = new ArgumentNullException("pBrickStates");
                Logger.Error(e.Message);
                throw e;
            }

            mBrickStates = pBrickStates;
        }
        #endregion

        #region Methods
        public List<BrickStateData> GetBrickStates()
        {
            return new List<BrickStateData>(mBrickStates);
        }

        public BrickStateData GetBrickState(string pBrickStateName)
        {
            return mBrickStates.FirstOrDefault(bsd => bsd.Name == pBrickStateName);
        }
        #endregion
    }
}